org 8000h
jmp start

%include "krnlib.inc"
%include "video.inc"
%include "gdt.inc"
%include "file.inc"

FILENAME	db		"KERNEL", 0

[bits 16]
start:
	push FILENAME
	push 0
	push 0x1000
	call ReadFile

	push 0x107
	call VideoMode

	cli
	call LoadGDT
	call EnterPM

	; far jump (cs = selector of code segment)
	jmp 08h:pm

[bits 32]
pm:
    mov ax, 0x10
    mov ds, ax
    mov ss, ax
    mov esp, 0x90000
    ; call ClearScreen

    ; mov ebx, 0B8000h
	; mov byte [ebx], 'a'
	; add ebx, 1
	; mov byte [ebx], 0fh

	jmp 08h:0x10400

;     jmp $
